import request from '@/utils/request'
import qs from 'qs'

export function merchantList(data) {
  return request({
    url: 'commerce/merchant/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function merchantAdd(data) {
  return request({
    url: 'commerce/merchant/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function merchantStatus(id) {
  return request({
    url: 'commerce/merchant/status',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

export function merchantDel(id) {
  return request({
    url: 'commerce/merchant/del',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

/** =================== 订单 ====================== */

export function orderList(data) {
  return request({
    url: 'commerce/order/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orderAdd(data) {
  return request({
    url: 'commerce/order/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orderStatus(id) {
  return request({
    url: 'commerce/order/status',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

export function orderDel(id) {
  return request({
    url: 'commerce/order/del',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

/** =================== 商品 ====================== */

export function goodsList(data) {
  return request({
    url: 'commerce/goods/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function goodsAdd(data) {
  return request({
    url: 'commerce/goods/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function goodsStatus(id) {
  return request({
    url: 'commerce/goods/status',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

export function goodsDel(id) {
  return request({
    url: 'commerce/goods/del',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

/** =================== 商品 集合 ====================== */

export function goodsSetList(data) {
  return request({
    url: 'commerce/goods_set/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

/** =================== 品牌 ====================== */

export function brandList(data) {
  return request({
    url: 'commerce/brand/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function brandAdd(data) {
  return request({
    url: 'commerce/brand/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function brandStatus(id) {
  return request({
    url: 'commerce/brand/status',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

export function brandDel(id) {
  return request({
    url: 'commerce/brand/del',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

/** =================== 商品分类 ====================== */

export function goodsCategoryList(data) {
  return request({
    url: 'commerce/goods_category/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function goodsCategoryAdd(data) {
  return request({
    url: 'commerce/goods_category/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function goodsCategoryStatus(id) {
  return request({
    url: 'commerce/goods_category/status',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

export function goodsCategoryDel(id) {
  return request({
    url: 'commerce/goods_category/del',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}
